import { ConfigProvider, App as AntdApp } from "antd/lib";
import "./App.css";
import { RouterProvider } from "react-router-dom";
import router from "@lgq/routes";
import React from "react";
import AntdGlobal from "./utils/AntdGlobal";

type ThemeData = {
  borderRadius: number;
  colorPrimary: string;
  Button?: {
    colorPrimary: string;
    algorithm?: boolean;
  };
};

const defaultData: ThemeData = {
  borderRadius: 6,
  colorPrimary: "#1677ff",
  Button: {
    colorPrimary: "#00B96B",
  },
};

function App() {
  const [data, setData] = React.useState<ThemeData>(defaultData);

  return (
    <>
      <ConfigProvider
        theme={{
          token: {
            colorPrimary: data.colorPrimary,
            borderRadius: data.borderRadius,
          },
        }}
      >
        <AntdApp>
          <AntdGlobal/>
          <RouterProvider router={router} />
        </AntdApp>
        {/* <HashRouter >
          <Router/>
        </HashRouter> */}
      </ConfigProvider>
    </>
  );
}

export default App;
